1. Field of the Invention
The present invention relates to an image processing apparatus that quantizes video data corresponding to a quantizer scale.
2. Description of the Related Art
As typified by a digital VTR (Video Tape Recorder), a data recording and reproducing apparatus that records a digital video signal and a digital audio signal to a record medium and that reproduces them therefrom is known. Since the data capacity of a digital video signal is huge, it is normally compression-encoded and then recorded to a record medium. In recent years, the MPEG2 (Moving Picture Experts Group 2) is known as a standard compression encoding system.
In the MPEG2, data that has been obtained by both a predictively encoding process that uses a motion detecting method and the DCT (Discrete Cosine Transform) process is quantized and compression-encoded. In addition, using a variable length code encoding process, the compression efficiency is improved. In an broadcasting station and so forth, to easily edit data and maintain the picture quality thereof, normally, data is not compressed in the chronological direction using a motion detecting method. A digital video signal is block-segmented and each block is processed corresponding to the DCT process. Obtained DCT coefficients of each block are quantized with a quantizer scale value selected for each block.
When video data that has been compression-encoded in the forgoing manner is edited, the video data is temporarily decoded as base band video data. After the video data has been edited, the base band video data is compression-encoded in the same manner. The resultant video data is recorded to a record medium such as a magnetic tape. At that point, when the quantizer scale value used in the compression-encoding process performed before video data is edited is the same as the quantizer scale value used in the compression-encoding process performed after video data is edited, no problem will take place. In contrast, when the quantizer scale value used in the compression-encoding process performed before video data is edited is different from the quantizer scale value used in the compression-encoding process performed after video data is edited, the picture quality of the video data that has been edited will be worse than the picture quality of the video data that has not been edited.
To solve such a problem, an algorithm for preventing the picture quality of dubbed data from deteriorating has been proposed. In the algorithm, when video data that has been temporarily compression-encoded is reproduced and decoded for a non-shift dubbing process or the like and then compression-encoded and recorded to the record medium, a quantizer scale value used in the preceding encoding process is detected. Using the detected quantizer scale value, the decoded data is re-encoded. In the following description, the algorithm for detecting the preceding quantizer scale value is referred to as back search.
As an example of a structure that performs the back search, in a video tape recorder using an MPEG2 compressing system, when an MPEG encoder performs quantizing calculations at multiple steps corresponding to the MPEG2 to perform a pre-encoding process, by summing “remainders” of dividing operations of individual steps, the MPEG encoder determines the preceding quantizer scale value. This method has been proposed as Japanese Patent Laid-Open Publication No. Hei 6-319112.
In other words, when the pre-encoding process is performed, before the actual encoding process is performed, the code amount is estimated. At that point, as the quantizing calculations at multiple steps, data is quantized with each of quantizer scale values prescribed in the MPEG2. “Remainders” of dividing operations of the quantizing process are used.
When the back search is performed using “remainder” as a result of the quantizing process, depending on the calculating method used in the hardware, there is a case that a fractional part of the result of a dividing operation should be multiplied by a devisor. As a result, the calculating process becomes complicated.
In addition, when “remainder” is obtained by multiplying a divisor by a fractional part, the value of “remainder” is proportional to the value of a divisor. However, when the value of “remainder” becomes large, in consideration of a calculation accuracy, by comparing data with designated parameter values, it was able to be determined whether or not data is divisible.